草庐IT

python - 导入tensorflow使python 3.6.5报错

全部标签

python - 为什么在 Windows 上的 Python 3 下创建模块后导入失败?

以下代码尝试创建然后导入两个模块:#coding:utf-8importosimporttime#Removethemoduleswe'reabouttocreateiftheyalreadyexistdefforce_unlink(name):try:os.unlink(name)exceptOSError:passforce_unlink("print1.py")force_unlink("print1.pyc")force_unlink("print2.py")force_unlink("print2.pyc")time.sleep(1)#Createmodule1andmodu

python-3.x - 为什么 Cygwin 在 Windows 上找不到已安装的 python 模块?

Windows10干净安装后,我安装了Python3.7.1,在安装结束时我选择将它添加到路径变量中,如果我愿意,会在选项中询问。然后我安装了Cygwin,之后我在Cygwin中安装了pipinstall--something。但是当我尝试导入该模块时,它抛出了找不到模块的错误。这里发生了什么? 最佳答案 您正在混合安装,但它不起作用。如果您需要在cygwin中使用Python,请使用它自己的版本。CygwinPython3的最新版本是3.6.4-1https://cygwin.com/packages/x86_64/python3

python - Windows 上的 asyncio create_subprocess_shell python 3.7

我正在尝试在Windows上测试一些异步功能。我正在使用Python3.7。这会提示一些NotImplementedErrorimportasyncioimportosimporttimeimportsys#thisworksasyncdefsay_after(delay,what):awaitasyncio.sleep(delay)print(what)#thisdoesn'tasyncdeftest_async(num):print('Task#{0}start'.format(num))proc=awaitasyncio.create_subprocess_shell('C:/P

c - 为什么 Windows 要求导入 DLL 数据?

在Windows上,可以从DLL加载数据,但需要通过导入地址表中的指针进行间接访问。因此,编译器必须知道正在访问的对象是否是使用__declspec(dllimport)从DLL导入的。类型说明符。这很不幸,因为这意味着设计用作静态库或动态库的Windows库的header需要知道程序链接到哪个版本的库。此要求不适用于函数,这些函数是为DLL透明地模拟的,stub函数调用实际函数,其地址存储在导入地址表中。在Linux上,动态链接器(ld.so)将所有链接数据对象的值从共享对象复制到每个进程的私有(private)映射区域。这不需要间接寻址,因为私有(private)映射区域的地址是模

python - python /畅达/ python /Windows : how to start and activate a conda environment?

我通过Anaconda安装了Python3.5(3.5.6),现在我希望能够使用Python3.7,将3.5保持为默认值(一个python"insertscriptname"将在命令行上运行)。我命令计算机激活它,但它不工作。WindowsPowerShellCopyright(C)MicrosoftCorporation.Allrightsreserved.PSC:\WINDOWS\system32>condacreate--nameseiskapython=3.7WARNING:Aspacewasdetectedinyourrequestedenvironmentpath'C:\P

python - 如何使用 python 在 Windows 上查找未分配的驱动器号

我需要通过python脚本在Windows上找到一个可用的驱动器盘符。Free代表未分配给任何物理或远程设备。我做了一些研究并在stackoverflow上找到了解决方案(不记得确切的链接):#forpython2.7importstringimportwin32apidefgetfreedriveletter():"""Findfirstfreedriveletter"""assigneddrives=win32api.GetLogicalDriveStrings().split('\000')[:-1]assigneddrives=[item.rstrip(':\\').lower

python - 如何在 Anaconda (Windows 10) 上安装 textract?

我正在尝试在Windows上安装Anaconda,但出现以下错误:Conda:screenshotoferrorPipinstall:screenshotoferror错误信息:(base)C:\Users\vinay>**condainstall-cconda-forgetextract**Solvingenvironment:**failed**PackagesNotFoundError:Thefollowingpackagesarenotavailablefromcurrentchannels:**-textract**Currentchannels:-https://conda

python - 如何用 face_recognition 模块做 python .exe 文件

我使用face_recognition模块进行编程,当我尝试为Windows制作.exe文件时,它不起作用。也许smb可以告诉我该怎么做? 最佳答案 从这里下载文件shape_predictor_68_face_landmarks.dathttp://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2并将其解压并放入C:\Users\YOUR_NAME\PycharmProjects\test_exe\dist\face_recognition_models\shape_

python - 如何在 Windows 上设置 python 多进程

我正在使用multiprocessingPython3.5.2(v3.5.2:4def2a2901a5,Jun252016,22:18:55)[MSCv.190064bit(AMD64)]onwin32中的模块.我正在尝试使用网上找到的最简单的玩具代码:frommultiprocessingimportProcessdeffoo():print('hello')p=Process(target=foo)p.start()我试过使用和不使用if__name__=="__main__":我不断收到错误:OSError:[Errno22]Invalidargument:'C:\\Users\

python - 属性错误 : module 'socket' has no attribute 'MSG_DONTWAIT'

我正在尝试在以下python代码中使用标志“MSG_DONTWAIT”:RECV_BUFFER_SIZE=1024buff=memoryview(bytearray(RECV_BUFFER_SIZE))x=client_socket.recv_into(buff,RECV_BUFFER_SIZE,socket.MSG_DONTWAIT)我刚刚从套接字读取数据的地方。奇怪的是,当我使用“MSG_WAITALL”标志时,代码工作正常,但它失败并出现以下错误:x=client_socket.recv_into(buff,RECV_BUFFER_SIZE,socket.MSG_DONTWAIT